﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="NativeMethods.cs" company="YellowFish">
//   Copyright © YellowFish 2009
// </copyright>
// <summary>
//   Defines the NativeMethods type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace MobilePal.WindowsNative.Notification
{
  #region Imported Namespaces


  using System;
  using System.Runtime.InteropServices;


  #endregion


  internal static class NativeMethods
  {
    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeClearUserNotification(int hNotification);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeGetUserNotification(int hNotification, uint cBufferSize, ref int pcBytesNeeded, 
                                                      IntPtr pBuffer);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeGetUserNotificationHandles(int[] rghNotifications, int cHandles, 
                                                             ref int pcHandlesNeeded);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeGetUserNotificationPreferences(IntPtr hWndParent, UserNotification lpNotification);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeHandleAppNotifications(string appName);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeRunAppAtEvent(string pwszAppName, int lWhichEvent);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool CeRunAppAtTime(string pwszAppName, ref SYSTEMTIME lpTime);


    [DllImport("coredll.dll", EntryPoint = "CeRunAppAtTime", SetLastError = true)]
    internal static extern bool CeRunAppAtTimeCancel(string pwszAppName, byte[] lpTime);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern int CeSetUserNotification(int hNotification, string pwszAppName, ref SYSTEMTIME lpTime, 
                                                     UserNotification lpUserNotification);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern int CeSetUserNotificationEx(int hNotification, UserNotificationTrigger lpTrigger, 
                                                       UserNotification lpUserNotification);


    [DllImport("coredll.dll", EntryPoint = "NLedGetDeviceInfo", SetLastError = true)]
    internal static extern bool NLedGetDeviceCount(short nID, ref Led.NLED_COUNT_INFO pOutput);


    [DllImport("coredll.dll", EntryPoint = "NLedGetDeviceInfo", SetLastError = true)]
    internal static extern bool NLedGetDeviceSupports(short nID, ref Led.NLED_SUPPORTS_INFO pOutput);


    [DllImport("coredll.dll", SetLastError = true)]
    internal static extern bool NLedSetDevice(short nID, ref Led.NLED_SETTINGS_INFO pOutput);
  }
}